<?php

namespace app\common\validate;

use think\Validate;

class StUser extends Validate
{
    //protected $batchValidate = true;
    //定义验证规则
    protected $rule = [
        'user_code'    => 'require',
        'user_name'   => 'require|max:25',
        'user_phone'  => 'number|require|length:1,12',
    ];

    //定义验证提示
    protected $message = [
        'user_code.require'  => '用户编号不能为空值哦',
        'user_name.require' => '用户姓名不能为空值哦',
        'user_phone.require'=> '用户手机号必须是数字',
        'user_phone.number' => '用户手机号必须是数字',
    ];
//    protected $scene = [
//        'addStUser'  =>  ['user_num','user_name','user_phone'],
//        'updateStUser'  =>  ['id'],
//    ];
}